<style scoped src="./index.scss" lang="scss" rel="stylesheet/scss"></style>
<template src="./index.html"></template>
<script>
    import Edit from "./../edit/index";
    export default {

        mixins: [Vue.prototype.$vFN.Mixins.Base, Vue.prototype.$vFN.Mixins.Page, Vue.prototype.$vFN.Mixins.Table],
        components: {
            ShareQrcodeBox: async () => Vue.extend(await Vue.prototype.$vFN.Components.Base.ShareQrcodeBox()),
        },
        data() {
            return {
                appWindow: window,
                // 页面接口地址
                apiUrl: {
                    list: "admin/store/index",
                    delete: "admin/store/del",
                },
                // 表格查询数据
                mixinTable_tableSearchData: {
                    name: "",
                },
                // 列表高级查询参数
                mixinTable_tableSearchSenior: {
                    category_id: {
                        type: Number,
                        value: null,
                        default: null,
                    },
                    status: {
                        type: Number,
                        value: null,
                        default: null,
                    },
                },
                // 表格数据
                tableData: [],
                // 表格数据删除展示结构
                tableDeleteConfig: {
                    columns: [{
                            label: "门店名称",
                            prop: "name",
                            type: ""
                        },
                        {
                            label: "店长姓名",
                            prop: "manage",
                            type: ""
                        },
                    ],
                },
                category: "",
          
                storeId: null,
            };
        },
        methods: {
            showCode(_id) {
                this.$refs["shareQrcodeBox" + _id].init({
                    config: {
                        path: "/packStore/home/index",
                        query: {
                            storeId: _id,
                        },
                    },
                });
             },
            async getClass() {
                let res = await this.$vFN.Http.post({
                    url: "admin/category/select",
                },this.appWindow);
                this.category = res.data.list;
            },
            // 打开添加/修改
            editBoxOpen(params_) {
                Edit.init({
                    mixinEdit_parent: this,
                    mixinEdit_editType: params_.type,
                    id: params_.id,
                })
            },
            // 初始化
            async init() {    
                this.getClass();

                this.mixinTable_refreshData();
            },

        },
        mounted() {
            this.init();
        },
        activated() {},
    };
</script>